//# sourceURL=applyUserInviteRecordList.js
layui.element.on('tab(login-user-tabs)', function () {
    var currPage = 1;
    var applyUserInviteRecordList_fn = {
        initRender: function () {
            layui.table.render({
                id: 'applyUserInviteRecordListTableId',
                elem: '#applyUserInviteRecordList-table',
                url: '/inviteRecord/list',
                height: 'full-170',
                page: true,
                limits: cmsUtils.getLimits(),
                limit: cmsUtils.getLimit(),
                cols:[[
                    {title: '<b>序号</b>',type: 'numbers',align: 'center',width: 80},
                    {title: '<b>求职岗位</b>',field: 'jobTitleValue'},
                    {title: '<b>公司名称</b>',field: 'companyName',width: 180},
                    {title: '<b>投递时间</b>',field: 'inviteDateStr',width: 180},
                    {title: '<b>状态</b>',field: 'statusName',width: 180},
                    {title: '<b>操作选项</b>',width: 160,align: 'center',toolbar: '#applyUserInviteRecordList-toolbar'}
                ]],
                done: function (res, curr, count) {
                    currPage = curr;
                    $('#applyUserInviteRecordList').attr('hasRender', true);
                }
            });
        },
        reload: function (page) {
            layui.table.reload('applyUserInviteRecordListTableId', {
                page:{
                    curr: page ? page : currPage
                }
            });
        },
        refreshList: function () {
            if ($('#applyUserInviteRecordList')[0]) {
                applyUserInviteRecordList_fn.reload(currPage);
            }
        },
        refreshList: function () {
            if ($('#applyUserInviteRecordList')[0]) {
                applyUserInviteRecordList_fn.reload(currPage);
            }
        },
        resetSearch: function () {
            applyUserInviteRecordList_fn.reload(1);
        }
    }
    if (!$('#applyUserInviteRecordList').attr('hasRender')) {
        applyUserInviteRecordList_fn.initRender();
        // 监听当前Tab页点击
        $(this).bind('tabClick', function () {
            applyUserInviteRecordList_fn.refreshList();
        });
        // 搜索
        $('#applyUserInviteRecordList-search-btn').click(function () {
            applyUserInviteRecordList_fn.reload(1);
        });
        // 重置
        $('#applyUserInviteRecordList-refresh-btn').click(function () {
            applyUserInviteRecordList_fn.resetSearch();
        });
        // 新增
        $('#applyUserInviteRecordList-add-btn').click(function () {
            cmsUtils.addContentTab('inviteRecordDetail', '投递记录-添加', '/piger/company/inviteCompanyEmpDetail.html', {
                list_fn: applyUserInviteRecordList_fn
            });
        });
    }
    // 工具条监听
    layui.table.on('tool(applyUserInviteRecordList-table)', function (obj) {
        switch (obj.event) {
            case 'edit':
                cmsUtils.addContentTab('inviteRecordDetail', '投递记录-编辑', '/piger/applyuser/applyUserInviteJobDetail.html', {
                    id: obj.data.id,
                    list_fn: applyUserInviteRecordList_fn
                });
                break;
            default:
                break;
        }
    });
});